<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>添加/修改用户</title>
<link rel="shortcut icon" type="image/ico" href="${basePath}/favicon.ico?v=1"/>
<link rel="stylesheet" type="text/css" href="${basePath}/css/style_2_common.css?BPm" />
<link href="${basePath}/css/style-1.css?id=103" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="${basePath}/css/default_user_com.css" media="all">
<link rel="stylesheet" type="text/css" href="${basePath}/js/layer/skin/layer.css" >
<script type="text/javascript" src="${basePath}/js/jquery-1.8.3.min.js"></script>
<script src="${basePath}/js/layer/layer.m.js" type="text/javascript"></script>
<style type="text/css" rel="stylesheet">
	input,textarea{width:400px;}
	select{width:100px;}
	textarea.px{height:50px;}
</style>
</head>
<body id="nv_member" class="pg_CURMODULE">
<#assign menu_index="menu_150">
<#assign current='menu_manuser'>
	<div id="wp" class="wp">
		<#include "/include/header.html"/>
		<div class="contentmanage">
			<div class="developer">
				<div class="tableContent">
                    <#include "/include/left.html"/>
                        <#include "/include/wxtop.html"/>
                    <div class="content">
						
						<div style="background: #fefbe4; border: 1px solid #f3ecb9; color: #993300; padding: 10px; margin-bottom: 5px; font-size: 12px; margin-top: 5px;">
							<#--温馨提示：用户默认密码是“ncb+员工号”。-->温馨提示：用户默认密码是“ncb+员工号”。
							
						</div>
						
						<form method="post" action="${basePath}/admin/user/save"  id="mainForm">
							<input type="hidden" name="id" value="${bean.id}"/>
							<div class="msgWrap">
							<table class="userinfoArea" border="0" cellspacing="0" cellpadding="0" width="100%">
								<tbody>
									<#--
									<tr>
										<th><span class="red">*</span>用户名：</th>
										<td>
											<input type="text" placeholder="请输入3-20位数字字母组合" class="px" name="username" value="${bean.username}" maxlength="20" <#if bean.id?exists> readonly="readonly" </#if> />
										</td>
									</tr>
									-->
									<tr>
										<th valign="top"><span class="red">*</span>员工工号：</th>
										<td>
											<input type="text" placeholder="工号为默认登录名且不能重复" class="px" name="username" value="${bean.username}" maxlength="20" <#if bean.id?exists> readonly="readonly" </#if> />
										</td>
									</tr>
									<tr>
										<th><span class="red"></span>用户角色：</th>
										<td>
											<select name="roleId">
												<option>请选择角色</option>
												<#list roles as role>
												<option value="${role.id}" <#if userrole??&&userrole.roleId==role.id>selected</#if>>${role.roleName}</option>
												</#list>
											</select> 
										</td>
									</tr>
									<tr>
										<th><span class="red"></span>所属机构：</th>
										<td>
											<select name="orgId">
												<option>请选择机构</option>
												<#list orgInfos as org>
												<option value="${org.orgInfoId}" <#if axdOrgInfo??&&axdOrgInfo.orgInfoId==org.orgInfoId>selected</#if>>${org.orgName}</option>
												</#list>
											</select> 
										</td>
									</tr>
									<tr>
										<th><span class="red"></span>是否启用：</th>
										<td>
											<select name="status">
												<option value="1">是</option>
												<option value="0" <#if bean.status==0>selected</#if> >否</option>
											</select> 
										</td>
									</tr>
									<tr>
										<th></th>
										<td><button type="button" class="btnGreen" onclick="saveIt();">保存</button></td>
									</tr>
								</tbody>
							</table>
							</div>
						</form>
					</div>
					<div class="clr"></div>
				</div>
			</div>
		</div>
		<!--底部-->
	</div>
	</div>
	</div>
	</div>
	<#include "/include/footer.html"/>
	<script type="text/javascript">
		function saveIt(){
			var $username=$("input[name='username']");
			var username=$username.val();
			var unReg = /^[a-zA-Z0-9_]{3,20}$/;
			if(""==username ||!unReg.test(username) ){
				layer.tips("用户名不规范！", $username.get(0));
				$username.focus();
				return false;
			}
			document.getElementById("mainForm").submit();		
		}
	</script>
</body>
</html>